package org.example.dto;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 多选框
 */
@Getter
@Setter
@EqualsAndHashCode
public class GenderCheckBox {

    public boolean boy;

    public boolean girl;

    public static GenderCheckBox of(Integer selectIndex) {
        GenderCheckBox checkbox = new GenderCheckBox();
        if (selectIndex == null) {
            return checkbox;
        }
        switch (selectIndex) {
            case 0:
                checkbox.boy = true;
                break;
            case 1:
                checkbox.girl = true;
                break;
        }
        return checkbox;
    }

}
